﻿using Microsoft.Data.Sqlite;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace UsersLabelPrint.DAL
{
    public class BarDbContext : DbContext
    {

        private static readonly string connectionString =  $@"data source=C:\Users\YANG.LEI\AppData\Roaming\UsersLabelPrint\userslabelprint.db;foreign keys=true";

        public BarDbContext() : this(new DbContextOptionsBuilder<BarDbContext>()
                   .UseSqlite(new SqliteConnection(connectionString))
                   .Options)
        {

        }
        public BarDbContext(DbContextOptions<BarDbContext> options) : base(options)
        {
        }

        public DbSet<DalPrinter> DalPrinters { get; set; }


        protected override void OnModelCreating(ModelBuilder builder)
        {
            base.OnModelCreating(builder);
        }
    }
}
